﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace block_explorer
{
    struct MapSectorVertex
    {
        private Vector3 mPosition;
        private Vector3 mNormal;
        private Vector2 mUV;
        private Vector4 mColor;

        public MapSectorVertex(Vector3 position, Vector3 normal, Vector2 uv, Color color)
        {
            mPosition = position;
            mNormal = normal;
            mUV = uv;
            mColor = new Vector4(color.R, color.G, color.B, color.A);
        }

        public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
            new VertexElement(sizeof(float) * 3, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),
            new VertexElement(sizeof(float) * 6, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
            new VertexElement(sizeof(float) * 8, VertexElementFormat.Vector4, VertexElementUsage.Color, 0)
        );
    }
}
